package day05;

import java.util.Scanner;

public class GuessDemo04 {
    public static void main(String[] args) {
        int num = (int)(Math.random()*100)+1;
        System.out.println(num);
        Scanner sc = new Scanner(System.in);
        while (true){
            System.out.println("请输入1-100的整数，猜吧。。。");
            int inputNum = sc.nextInt();
            if(inputNum == num){
                System.out.println("猜对了，你太棒了");
                break;
            }else if(inputNum > num){
                System.out.println("猜大了。。");
            }else if(inputNum < num){
                System.out.println("猜小了！！！");
            }

        }



    }
}
